package com.ywgt.functioninterface;

import java.util.function.Predicate;

public class PredicateTest {
    public static void main(String[] args) {
        Predicate<String> predicate = new Predicate<String>() {
            @Override
            public boolean test(String str) {
                return str.length() > 5;
            }
        };

        Predicate<String> pred=(str)->{return str.length()==5;};
        System.out.println(predicate.test("45asd"));
        System.out.println(pred.test("45asd"));
    }
}
